#! /bin/bash
rm package-lock.json
CONTAINER_NAME=form-designer
IMAGE_NAME=form-designer

if [ "$(docker ps -q -f name=$CONTAINER_NAME)" ]; then
    docker rm -f $CONTAINER_NAME
    docker image prune --force --all
fi

docker build -t $IMAGE_NAME .
docker run -d -p 80:80 --name $CONTAINER_NAME $IMAGE_NAME